<include file="Public:header"/>
<script src="__ADMIN__/js/jquery-1.4.2.min.js"></script>
<div class="aright">
<div class="arz" style="float: left;margin: 0px 20px 20px 30px;"><a href="{:U('article/add')}"><i class="layui-icon">&#xe608;</i>添加文章</a></div>

<div style="float: left;">
<form class="layui-form" action="{:U('article/index')}" method="get">
<input placeholder="输入关键字" name="kw" value="<?php echo I('kw');?>" type="text" class="layui-input" style="float: left;margin-right: 10px;width: 300px;">
<button class="layui-btn" style="float: left;" value="查询" type="submit">查询</button>
</form>
</div>

<form method="post" class="aform cl" action="{:U('article/deletes')}">
<table width="100%">
      <tr>
	    <th width="5%" align="center"><input type="checkbox" name="checkbox" id="selall" /></th>
		<th width="5%" align="center">编号</th>
        <th width="25%" align="center">文章标题</th>
		<th width="10%" align="center">缩略图</th>
        <th width="10%" align="center">是否推荐</th>
		<th width="9%" align="center">是否精选</th>
		<th width="9%" align="center">所属栏目</th>
		<th width="9%" align="center">审核显示</th>
		<th width="9%" align="center">添加时间</th>
        <th width="9%" align="center">基本操作</th>
      </tr>
      <volist name="list" id="vo">
	  <tr>
	    <td align="center"><input type="checkbox" class="selall" name="deletes[]" value="{$vo.id}" /></td>
		<td align="center">{$vo.id}</td>
        <td align="center"><a target="_blank" href="__ROOT__/index.php?m=Home&c=index&a=article&id={$vo.id}">{$vo.title}</a></td>
		<td align="center">
		<if condition="$vo[pic] neq ''">
        <img src="__ROOT__/Uploads{$vo.pic}" height="30">
        <else /> 
        暂无缩略图
        </if>
		</td>
		<td align="center"><if condition="$vo[commend] eq 1"><span style="color:#FF5722;">已推荐</span><else />未推荐</if></td>
		<td align="center"><if condition="$vo[choice] eq 1"><span style="color:#FF5722;">已精选</span><else />未精选</if></td>
		<td align="center"><if condition="$vo[tid] eq 0"><span style="color:#FF5722;">投稿栏目</span><else />{$vo.name}</if></td>
		<td align="center"><if condition="$vo[open] eq 0"><span style="color:#FF5722;">待审核</span><else />显示</if></td>
		<td align="center">{$vo.time|date="Y-n-d",###}</td>
        <td align="center"><a href="{:U('article/edit',array('id'=>$vo['id']))}">修改</a> | <a href="{:U('article/delete',array('id'=>$vo['id']))}" onclick="return confirm('您确定要删除吗？');">删除</a>
        </td>
      </tr>
      </volist>
 </table>
<div class="layui-form-item">
    <div style="margin-top: 20px;">
	  <button class="layui-btn" onclick="return confirm('您确定要删除吗？');" type="submit">删除选中</button>
      <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
    </div>
</div>
 </form>
 <div class="pages">
 {$page}
 </div>
</div>
</div>
<script>
$("#selall").click(function(){
    if($(this).attr("checked")){
		$(".selall").attr("checked","checked");
	}else{
		$(".selall").removeAttr("checked");
	}

})
</script>
</body>
</html>